import JSONbig from 'json-bigint'
//  系统相关的接口
import request from '@/utils/request'
//  获取登陆票据
export function getToken(data) {
  return request({
    method: 'post',
    url: '/system/token/getToken',
    data
  })
}
//  ok 获取公告 
export function getNoticeList(data) {
  return request({
    method: 'post',
    url: '/system/notice/list',
    transformResponse: [function (data) {
      return JSONbig.parse(data)
    }],
    data
  })
}
//  ok 获取banner广告
export function getBannerList(query) {
  return request({
    url: '/system/banner/list',
    params: query
  })
}
//  ok 获取医师专业列表
export function getMajorList(query) {
  return request({
    url: '/system/major/list',
    params: query
  })
}
//  ok 获取医疗保健项列表 我要寻医里的疾病类型
export function getDiseaseList(query) {
  return request({
    url: '/system/disease/list',
    params: query
  })
}
//  ok 文章列表
export function getArticleList(data) {
  return request({
    method: 'post',
    url: '/system/article/list',
    transformResponse: [function (data) {
      return JSONbig.parse(data)
    }],
    data
  })
}
// ok 首页推荐医生列表
export function getDoctorRecommend() {
  return request({
    url: '/user/patient/pushDoctorList',
    transformResponse: [function (data) {
      return JSONbig.parse(data)
    }]
  })
}
// 获取服务评价的关键字
export function getKeywords(query) {
  return request({
    url: '/system/evaluate/keywords',
    params: query
  })
}
//  ok 获取搜索里的关键字
export function getSearch(query) {
  return request({
    url: '/system/search/keywords',
    params: query
  })
}
//  上传意见反馈
export function upFeedback(data) {
  return request({
    method: 'put',
    url: '/system/feedback/add',
    data
  })
}
//  添加收藏
export function addCollect(data) {
  return request({
    method: 'post',
    url: '/system/collect/add',
    transformResponse: [function (data) {
      return JSONbig.parse(data)
    }],
    data
  })
}
//  取消收藏
export function deleteCollect(data) {
  return request({
    method: 'post',
    url: '/system/collect/delete',
    transformResponse: [function (data) {
      return JSONbig.parse(data)
    }],
    data
  })
}
//  删除个人消息
export function deleteNotice(query) {
  return request({
    url: '/system/notice/delete',
    params: query,
    transformResponse: [function (data) {
      return JSONbig.parse(data)
    }]
  })
}
//  阅读个人消息（消息详情）
export function readNotice(query) {
  return request({
    url: '/system/notice/read',
    params: query,
    transformResponse: [function (data) {
      return JSONbig.parse(data)
    }]
  })
}
//  意见反馈标签语
export function feedbackTags(query) {
  return request({
    url: '/system/feedback/tags',
    params: query
  })
}
//  合并
export default {
  getToken,
  getNoticeList,
  getBannerList,
  getMajorList,
  getDiseaseList,
  getArticleList,
  getDoctorRecommend,
  getKeywords,
  getSearch,
  upFeedback,
  addCollect,
  deleteCollect,
  deleteNotice,
  readNotice,
  feedbackTags
}